home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10017 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: isonews.bbn.hp.com!hpbblb!news
  2. From: Matthias Dittrich <matti>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Invalid Indirection???
  5. Date: 15 Mar 1996 08:55:57 GMT
  6. Organization: Hewlett-Packard Co.
  7. Message-ID: <4ibbat$pin@hpbblb.bbn.hp.com>
  8. References: <4i7cck$t67@infa.central.susx.ac.uk>
  9. NNTP-Posting-Host: trabant.bbn.hp.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
  14. X-URL: news:4i7cck$t67@infa.central.susx.ac.uk
  15.  
  16. taux5@central.susx.ac.uk (Doan Nguyen) wrote:
  17. >I'm pretty new to C programming but I do know Modula-2 quite well and I
  18. >was wondering if there was anyone out there who could tell me what
  19. >the error "Invalid Indirection" means in C??
  20. >
  21. >I'm writing a program to map some Fourier data into it's r and theta
  22. >components. I'm converting this function from it's Fortran equivalent
  23. >and that's why I'm using arrays.
  24. >
  25. >
  26. >void Map_RTheta ( float *data )
  27. >{
  28. >
  29. >float tempa, tempb, tempi, tempj [NPIC-1];
  30. >float xmap, ymap, rmap, Tmap [NPIC-1];
  31. >float r, xi, yi, val, tmp;
  32. >float pi, theta;
  33. >int i, j;
  34. >float *tempi_p;
  35. >float *tempj_p;
  36. >boolean test;
  37. >
  38. >tempi_p = &tempi;
  39. >tempj_p = &tempj;
  40. >pi = 3.14159265359;
  41. >
  42. >    for (i=0;i<=NPIC-1; i+=2) {          /* Copies Fourier Data into  */
  43. >       *(data + i) = *(tempi_p + i);     /* tempi and tempj array     */
  44. >    }
  45. >
  46. >    for (j=1; j<=NPIC-1; j+=2) {
  47. >       *(data + j) = *(tempj_p +(j-1));
  48. >    }
  49. >
  50. >    for (j=0;j<=NPIC-1; j+=2) {
  51. >    theta = pi*(int)j / (NPIC-1);
  52. >        for (i=0;i<=NPIC-1; i++) {
  53. >           r = (int)i / sqrt(2.0);
  54. >           xi = r*sin(theta);
  55. >           yi = -(r)*cos(theta);
  56. >           val = xi+NHP;
  57. >           tmp = (tempi[i]*tempj[i])+(tempi[i+1]*tempj[i+1]));
  58.                                                                     ^
  59. I've never seen this compiler message, but I think this one close bracket
  60. may be your error.
  61.  
  62. >    
  63. >/* This is where the compiler stops and says there's an invalid
  64. >indirection for the "tmp" assignment */
  65. >
  66. >        }
  67. >    }
  68. >}
  69. >......
  70.  
  71. Good luck,
  72. Matthias
  73.  
  74.